package com.jt.controller;

import com.fasterxml.jackson.databind.util.JSONPObject;
import com.jt.service.MobileCodeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author dc
 * @Classname MobileCodeController
 * @Date 2020/5/26 9:06
 */
@RestController
@RequestMapping("/notifyUser")
public class MobileCodeController {

    @Autowired
    private MobileCodeService mobileCodeService;

    @RequestMapping("/mobileCode")
    public JSONPObject doValidateMobileCode(String mobile,String callback){
        JSONPObject jsonpObject;
        jsonpObject = new JSONPObject(callback, mobileCodeService.sendMobileCode(mobile));
        return jsonpObject;
    }

}
